package net.canang.codegen.engine.domain;

import org.apache.commons.lang.StringUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * todo: comment
 */
public class Domain {

    private String name;
    private String javaName;
    private String description;
    private String prefix;
    private String pkg;
    private List<Model> models;

    public Domain() {
        this.models = new ArrayList<Model>();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
        this.javaName = org.apache.velocity.util.StringUtils.firstLetterCaps(name);

    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getPrefix() {
        return prefix;
    }

    public void setPrefix(String prefix) {
        this.prefix = prefix;
    }

    public String getJavaName() {
        return javaName;
    }

    public void setJavaName(String javaName) {
        this.javaName = javaName;
    }

    public String getPkg() {
        return pkg;
    }

    public void setPkg(String pkg) {
        this.pkg = pkg;
    }

    public List<Model> getModels() {
        return models;
    }

    public void setModels(List<Model> models) {
        this.models = models;
    }

    public void addModel(Model model) {
        model.setDomain(this);
        this.models.add(model);
    }
}
